<?php

namespace IDock\Insurance\QHIC\Response;

use IDock\Http\Response;
use IDock\Insurance\QHIC\Response\AllQHICResponse;
use IDock\Printer\VehicleActualValuePrinter;

class VehicleActualValueResponse extends AllQHICResponse
{
    /**
     * @var VehicleActualValuePrinter $printer
     */
    public $printer = VehicleActualValuePrinter::class;


    public function printerInit(): Response
    {
        $this->printer = new VehicleActualValuePrinter();
        $this->printer->actualValue = $this->getBody()['NActualValue'] ?? '0';
        if(empty($this->printer->actualValue)){
            $this->setError('获取车辆实际价格失败');
            return $this;
        }
        return $this;
    }
}
